<?php

namespace app\membercall\controller;

/** 控制器类引入区 **/
use app\common\controller\Smscm;

/** 模型类引入区 **/
use app\common\model\Project as ProjectM;
use app\common\model\ProjectCategory;

/** 核心或第三方类引入区 **/

use my\Wx;
use think\Db;
use think\Validate;

/**
 * 商品控制器
 * @package app\api\controller
 */
class User extends Home
{
    public $noNeedLogin = [];

    /**
     * 搜索用户
     */
    public function search(){
        if ($this->request->isPost()) {
            $getData = $this->request->post();
            if(!isset($getData['phone']) || empty($getData['phone'])){
                $this->result('缺少参数', '', 204);
            }
            $result =Db::name('qt_user_viper')->alias('uv')
                ->field('uv.id,uv.phone,uv.nickname,r.name')
                ->leftJoin('qt_rank r','uv.rank = r.id')
                ->where(['uv.phone'=>$getData['phone']])
                ->find();
            $this->result('查询成功', $result, 200);
        }
        $this->result('无效的请求方式', '', 204);
    }

}
